-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add workflow_job webhook #33694
Open
ChristopherHX
wants to merge
12
commits into
go-gitea:main
Choose a base branch
from
ChristopherHX:workflow_job_webhook_bp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add workflow_job webhook #33694
ChristopherHX
wants to merge
12
commits into
go-gitea:main
from
ChristopherHX:workflow_job_webhook_bp
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fixup initial working draft Add more fields More Complete
BTW, I might need help write tests these for webhooks. This can get complex for me. Example Webhooks (two jobs, one depends on the other){
"action": "queued",
"workflow_job": {
"id": 344,
"run_id": 825,
"run_url": "http://localhost:3000/test/private-repo/actions/runs/10",
"name": "download",
"labels": [
"ephemeral"
],
"run_attempt": 2,
"head_sha": "a33e70fae58cce6ddf3a3e4c33e7be4fe5ea1533",
"head_branch": "ephemeral",
"runner_id": 0,
"runner_name": "",
"steps": null,
"created_at": "2025-02-23T14:51:50Z",
"started_at": "1970-01-01T00:00:00Z",
"completed_at": "1970-01-01T00:00:00Z"
},
"repository": {
"id": 65,
"owner": {
"id": 43,
"login": "test",
"login_name": "",
"source_id": 0,
"full_name": "",
"email": "test@test.com",
"avatar_url": "http://localhost:3000/avatars/b642b4217b34b1e8d3bd915fc65c4452",
"html_url": "http://localhost:3000/test",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2025-02-10T13:25:00+01:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "test"
},
"name": "private-repo",
"full_name": "test/private-repo",
"description": "",
"empty": false,
"private": true,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 33,
"language": "",
"languages_url": "http://localhost:3000/api/v1/repos/test/private-repo/languages",
"html_url": "http://localhost:3000/test/private-repo",
"url": "http://localhost:3000/api/v1/repos/test/private-repo",
"link": "",
"ssh_url": "christopher@localhost:test/private-repo.git",
"clone_url": "http://localhost:3000/test/private-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 0,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2025-02-10T20:40:44+01:00",
"updated_at": "2025-02-23T19:37:50+01:00",
"archived_at": "1970-01-01T01:00:00+01:00",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"projects_mode": "all",
"has_releases": true,
"has_packages": true,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_fast_forward_only_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"object_format_name": "sha1",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null,
"topics": [],
"licenses": null
},
"sender": {
"id": 43,
"login": "test",
"login_name": "",
"source_id": 0,
"full_name": "",
"email": "test@noreply.localhost",
"avatar_url": "http://localhost:3000/avatars/b642b4217b34b1e8d3bd915fc65c4452",
"html_url": "http://localhost:3000/test",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2025-02-10T13:25:00+01:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "test"
}
} {
"action": "completed",
"workflow_job": {
"id": 343,
"run_id": 825,
"run_url": "http://localhost:3000/test/private-repo/actions/runs/10",
"name": "_",
"labels": [
"ephemeral"
],
"run_attempt": 3,
"head_sha": "a33e70fae58cce6ddf3a3e4c33e7be4fe5ea1533",
"head_branch": "ephemeral",
"conclusion": "success",
"runner_id": 194,
"runner_name": "",
"steps": [
{
"name": "christopherhx/gitea-upload-artifact@v4",
"number": 0,
"conclusion": "success",
"started_at": "2025-02-23T18:37:48Z",
"completed_at": "2025-02-23T18:37:49Z"
}
],
"created_at": "2025-02-23T14:51:50Z",
"started_at": "2025-02-23T18:37:48Z",
"completed_at": "2025-02-23T18:37:49Z"
},
"repository": {
"id": 65,
"owner": {
"id": 43,
"login": "test",
"login_name": "",
"source_id": 0,
"full_name": "",
"email": "test@test.com",
"avatar_url": "http://localhost:3000/avatars/b642b4217b34b1e8d3bd915fc65c4452",
"html_url": "http://localhost:3000/test",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2025-02-10T13:25:00+01:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "test"
},
"name": "private-repo",
"full_name": "test/private-repo",
"description": "",
"empty": false,
"private": true,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 33,
"language": "",
"languages_url": "http://localhost:3000/api/v1/repos/test/private-repo/languages",
"html_url": "http://localhost:3000/test/private-repo",
"url": "http://localhost:3000/api/v1/repos/test/private-repo",
"link": "",
"ssh_url": "christopher@localhost:test/private-repo.git",
"clone_url": "http://localhost:3000/test/private-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 0,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2025-02-10T20:40:44+01:00",
"updated_at": "2025-02-23T19:37:49+01:00",
"archived_at": "1970-01-01T01:00:00+01:00",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"projects_mode": "all",
"has_releases": true,
"has_packages": true,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_fast_forward_only_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"object_format_name": "sha1",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null,
"topics": [],
"licenses": null
},
"sender": {
"id": 43,
"login": "test",
"login_name": "",
"source_id": 0,
"full_name": "",
"email": "test@noreply.localhost",
"avatar_url": "http://localhost:3000/avatars/b642b4217b34b1e8d3bd915fc65c4452",
"html_url": "http://localhost:3000/test",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2025-02-10T13:25:00+01:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "test"
}
} {
"action": "in_progress",
"workflow_job": {
"id": 343,
"run_id": 825,
"run_url": "http://localhost:3000/test/private-repo/actions/runs/10",
"name": "_",
"labels": [
"ephemeral"
],
"run_attempt": 3,
"head_sha": "a33e70fae58cce6ddf3a3e4c33e7be4fe5ea1533",
"head_branch": "ephemeral",
"runner_id": 194,
"runner_name": "",
"steps": [
{
"name": "christopherhx/gitea-upload-artifact@v4",
"number": 0,
"started_at": "1970-01-01T00:00:00Z",
"completed_at": "1970-01-01T00:00:00Z"
}
],
"created_at": "2025-02-23T14:51:50Z",
"started_at": "2025-02-23T18:37:48Z",
"completed_at": "1970-01-01T00:00:00Z"
},
"repository": {
"id": 65,
"owner": {
"id": 43,
"login": "test",
"login_name": "",
"source_id": 0,
"full_name": "",
"email": "test@test.com",
"avatar_url": "http://localhost:3000/avatars/b642b4217b34b1e8d3bd915fc65c4452",
"html_url": "http://localhost:3000/test",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2025-02-10T13:25:00+01:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "test"
},
"name": "private-repo",
"full_name": "test/private-repo",
"description": "",
"empty": false,
"private": true,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 33,
"language": "",
"languages_url": "http://localhost:3000/api/v1/repos/test/private-repo/languages",
"html_url": "http://localhost:3000/test/private-repo",
"url": "http://localhost:3000/api/v1/repos/test/private-repo",
"link": "",
"ssh_url": "christopher@localhost:test/private-repo.git",
"clone_url": "http://localhost:3000/test/private-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 0,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2025-02-10T20:40:44+01:00",
"updated_at": "2025-02-23T19:37:46+01:00",
"archived_at": "1970-01-01T01:00:00+01:00",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"projects_mode": "all",
"has_releases": true,
"has_packages": true,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_fast_forward_only_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"object_format_name": "sha1",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null,
"topics": [],
"licenses": null
},
"sender": {
"id": 43,
"login": "test",
"login_name": "",
"source_id": 0,
"full_name": "",
"email": "test@noreply.localhost",
"avatar_url": "http://localhost:3000/avatars/b642b4217b34b1e8d3bd915fc65c4452",
"html_url": "http://localhost:3000/test",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2025-02-10T13:25:00+01:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "test"
}
} {
"action": "waiting",
"workflow_job": {
"id": 344,
"run_id": 825,
"run_url": "http://localhost:3000/test/private-repo/actions/runs/10",
"name": "download",
"labels": [
"ephemeral"
],
"run_attempt": 2,
"head_sha": "a33e70fae58cce6ddf3a3e4c33e7be4fe5ea1533",
"head_branch": "ephemeral",
"runner_id": 0,
"runner_name": "",
"steps": null,
"created_at": "2025-02-23T14:51:50Z",
"started_at": "1970-01-01T00:00:00Z",
"completed_at": "1970-01-01T00:00:00Z"
},
"repository": {
"id": 65,
"owner": {
"id": 43,
"login": "test",
"login_name": "",
"source_id": 0,
"full_name": "",
"email": "test@test.com",
"avatar_url": "http://localhost:3000/avatars/b642b4217b34b1e8d3bd915fc65c4452",
"html_url": "http://localhost:3000/test",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2025-02-10T13:25:00+01:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "test"
},
"name": "private-repo",
"full_name": "test/private-repo",
"description": "",
"empty": false,
"private": true,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 33,
"language": "",
"languages_url": "http://localhost:3000/api/v1/repos/test/private-repo/languages",
"html_url": "http://localhost:3000/test/private-repo",
"url": "http://localhost:3000/api/v1/repos/test/private-repo",
"link": "",
"ssh_url": "christopher@localhost:test/private-repo.git",
"clone_url": "http://localhost:3000/test/private-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 0,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2025-02-10T20:40:44+01:00",
"updated_at": "2025-02-23T16:38:21+01:00",
"archived_at": "1970-01-01T01:00:00+01:00",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"projects_mode": "all",
"has_releases": true,
"has_packages": true,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_fast_forward_only_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"object_format_name": "sha1",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null,
"topics": [],
"licenses": null
},
"sender": {
"id": 43,
"login": "test",
"login_name": "",
"source_id": 0,
"full_name": "",
"email": "test@noreply.localhost",
"avatar_url": "http://localhost:3000/avatars/b642b4217b34b1e8d3bd915fc65c4452",
"html_url": "http://localhost:3000/test",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2025-02-10T13:25:00+01:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "test"
}
} {
"action": "queued",
"workflow_job": {
"id": 343,
"run_id": 825,
"run_url": "http://localhost:3000/test/private-repo/actions/runs/10",
"name": "_",
"labels": [
"ephemeral"
],
"run_attempt": 2,
"head_sha": "a33e70fae58cce6ddf3a3e4c33e7be4fe5ea1533",
"head_branch": "ephemeral",
"runner_id": 0,
"runner_name": "",
"steps": null,
"created_at": "2025-02-23T14:51:50Z",
"started_at": "1970-01-01T00:00:00Z",
"completed_at": "1970-01-01T00:00:00Z"
},
"repository": {
"id": 65,
"owner": {
"id": 43,
"login": "test",
"login_name": "",
"source_id": 0,
"full_name": "",
"email": "test@test.com",
"avatar_url": "http://localhost:3000/avatars/b642b4217b34b1e8d3bd915fc65c4452",
"html_url": "http://localhost:3000/test",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2025-02-10T13:25:00+01:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "test"
},
"name": "private-repo",
"full_name": "test/private-repo",
"description": "",
"empty": false,
"private": true,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 33,
"language": "",
"languages_url": "http://localhost:3000/api/v1/repos/test/private-repo/languages",
"html_url": "http://localhost:3000/test/private-repo",
"url": "http://localhost:3000/api/v1/repos/test/private-repo",
"link": "",
"ssh_url": "christopher@localhost:test/private-repo.git",
"clone_url": "http://localhost:3000/test/private-repo.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 0,
"release_counter": 0,
"default_branch": "main",
"archived": false,
"created_at": "2025-02-10T20:40:44+01:00",
"updated_at": "2025-02-23T16:38:21+01:00",
"archived_at": "1970-01-01T01:00:00+01:00",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"projects_mode": "all",
"has_releases": true,
"has_packages": true,
"has_actions": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"allow_fast_forward_only_merge": true,
"allow_rebase_update": true,
"default_delete_branch_after_merge": false,
"default_merge_style": "merge",
"default_allow_maintainer_edit": false,
"avatar_url": "",
"internal": false,
"mirror_interval": "",
"object_format_name": "sha1",
"mirror_updated": "0001-01-01T00:00:00Z",
"repo_transfer": null,
"topics": [],
"licenses": null
},
"sender": {
"id": 43,
"login": "test",
"login_name": "",
"source_id": 0,
"full_name": "",
"email": "test@noreply.localhost",
"avatar_url": "http://localhost:3000/avatars/b642b4217b34b1e8d3bd915fc65c4452",
"html_url": "http://localhost:3000/test",
"language": "",
"is_admin": false,
"last_login": "0001-01-01T00:00:00Z",
"created": "2025-02-10T13:25:00+01:00",
"restricted": false,
"active": false,
"prohibit_login": false,
"location": "",
"website": "",
"description": "",
"visibility": "public",
"followers_count": 0,
"following_count": 0,
"starred_repos_count": 0,
"username": "test"
}
} |
There are some examples in |
lunny
reviewed
Feb 24, 2025
lunny
reviewed
Feb 24, 2025
* add URL field * add HTMLURL field * fix run_url to return api url instead of html url
Notice for myself: Possible missing completed event for scenario: CancelPreviousJobs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
modifies/api
This PR adds API routes or modifies them
modifies/go
Pull requests that update Go code
modifies/templates
This PR modifies the template files
modifies/translation
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provide external Integration information about the Queue lossly based on https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=completed#workflow_job
Naming conflicts between GitHub & Gitea are here, Blocked => Waiting, Waiting => Queued
Rationale Enhancement for ephemeral runners management #33570